package com.fms.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fms.entity.WarehouseHardware;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

@Repository
public interface WarehouseHardwareMapper extends BaseMapper<WarehouseHardware> {
    @Update("UPDATE warehouse_hardware SET hardware_amount = hardware_amount - #{amount} WHERE id = #{id}")
    void updateWarehouseHardwareOutAmount(Integer amount, Long id);
    @Update("UPDATE warehouse_hardware SET hardware_amount = hardware_amount + #{addHardwareAmount} WHERE id = #{id}")
    void rollbackAmount(Integer addHardwareAmount, Long id);
}
